Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ios): support capture 'quality' param for videos #214

Merged
merged 6 commits into from
Jul 31, 2023

Conversation

ath0mas
Copy link
Contributor

@ath0mas ath0mas commented Mar 31, 2021

Platforms affected

iOS

Motivation and Context

Use quality param for video capture on iOS too.
Previously no configuration was done about it, meaning that the quality used for capture was medium as iOS default value.

Here is my suggested implementation based on previous PR #162 by @larrybahr with changes after my review and more tests + aligned default to 1 for iOS as it is for Android.

Description

Follow iOS logic about video quality: doc

quality value of 0 for UIImagePickerControllerQualityTypeLow, 0.5 for UIImagePickerControllerQualityTypeMedium, or 1 for UIImagePickerControllerQualityTypeHigh.

For any other value or when quality param is not provided we use UIImagePickerControllerQualityTypeMedium UIImagePickerControllerQualityTypeHigh.

Testing

Confirmed the switch-case resolution with various quality values: 0, 0.5, 1, 2, 'foo', false, undefined, and without any captureOpts.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@gbrits
Copy link

gbrits commented May 12, 2021

🚀 ?

@ath0mas
Copy link
Contributor Author

ath0mas commented May 18, 2021

@gbrits waiting for this merge and some others, so I currently use my own published fork cordova-plugin-ns0m-media-capture

@ath0mas ath0mas mentioned this pull request Apr 28, 2022
@Schallenballa
Copy link

Would really appreciate this feature. Currently, have to go into the CDVCapture.m each time after a build and manually change the quality to be high.

@erisu erisu changed the title (iOS) Capture video with 'quality' param feat(ios): support capture 'quality' param for videos Jul 20, 2023
www/CaptureVideoOptions.js Outdated Show resolved Hide resolved
src/ios/CDVCapture.m Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@ath0mas
Copy link
Contributor Author

ath0mas commented Jul 21, 2023

@erisu thanks for the review, I'll comment and update this in a week or so 👍

@ath0mas ath0mas force-pushed the feature/quality-ios branch from 87df9f3 to 3debc54 Compare July 30, 2023 20:27
Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes LGTM

@erisu erisu merged commit dfe3716 into apache:master Jul 31, 2023
@ath0mas ath0mas deleted the feature/quality-ios branch July 31, 2023 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants